package com.cy.server.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cy.server.pojo.Admin;
import com.cy.server.pojo.Menu;
import com.cy.server.pojo.RespBean;
import com.cy.server.pojo.Role;
import org.springframework.security.core.Authentication;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author LiShaoZhuo
 * @since 2021-04-26
 */
public interface IAdminService extends IService<Admin> {

    /**
    * @Description: 登录之后返回token
    * @Param: userName,passWord,request
    * @return:
    * @Author: LiShaoZhuo
    * @Date: 2021/4/26
    */
    RespBean login(String userName, String passWord, String code, HttpServletRequest request);

    /**
    * @Description: 根据用户名获取用户
    * @Param: userName
    * @return:
    * @Author: LiShaoZhuo
    * @Date: 2021/4/26
    */
    Admin getAdminByUserName(String userName);

    /**
    * @Description: 根据id获取角色
    * @Param: adminId
    * @return:
    * @Author: LiShaoZhuo
    * @Date: 2021/4/29
    */
    List<Role> getRolesByAdminId(Integer adminId);

    /**
    * @Description:  获取所有操作员
    * @Param:
    * @return:
    * @Author: LiShaoZhuo
    * @Date: 2021/4/30
    */
    List<Admin> getAllAdmins(String keywords);

    /**
     * @Description: 更新操作员角色
     * @Param:
     * @return:
     * @Author: LiShaoZhuo
     * @Date: 2021/4/30
     */
    RespBean updateAdminRole(Integer adminId, Integer[] rids);

    /**
    * @Description: 更新用户密码
    * @Param:
    * @return:
    * @Author: LiShaoZhuo
    * @Date: 2021/5/10
    */
    RespBean updateAdminPassword(String oldPass, String pass, Integer adminId);

    /**
    * @Description: 更新用户头像
    * @Param:
    * @return:
    * @Author: LiShaoZhuo
    * @Date: 2021/5/11
    */
    RespBean updateAdminUserface(String url, Integer id, Authentication authentication);
}
